function [NoPrecondIter,JacobianPrecondIter,...
    NoPrecondCondNumPowerMethod,JacobianPrecondCondNumPowerMethod,...
    NoPrecondCondNumByDef,JacobianPrecondCondNumByDef] = testCalculatePreconditioner2D(n,doSvd,precision)
    NoPrecondIter=0;
    JacobianPrecondIter=0;
    NoPrecondCondNumPowerMethod=0;
    JacobianPrecondCondNumPowerMethod=0;
    NoPrecondCondNumByDef=0;
    JacobianPrecondCondNumByDef=0;
    cgtol=1e-12;
    fprintf('2D: starting to test n = %d\n',n);
    tic
    [NoPrecondH,~]=calculatePreconditioner2D(n,0,precision);
    [JacobianPrecondH,~]=calculatePreconditioner2D(n,1,precision);
    %[~,DiagonalPrecond]=calculatePreconditioner2D(n,2,precision);
    toc
    fprintf('2D: finished calculating H filter\n');
    tic
    NoPrecondCondNumPowerMethod=calculateConditionNumber2DByPowerMethod(NoPrecondH,cgtol,100,0,n,0,precision);
    JacobianPrecondCondNumPowerMethod=calculateConditionNumber2DByPowerMethod(JacobianPrecondH,cgtol,100,0,n,0,precision);
    %DiagonalPrecondCondNumPowerMethod=calculateConditionNumber2DByPowerMethod(DiagonalPrecond,cgtol,100,0,n,1,precision);
    toc
    fprintf('2D: finished calculating condition number by power method\n');
    JacobianRatioCondNumPowerMethod=JacobianPrecondCondNumPowerMethod/NoPrecondCondNumPowerMethod;
    fprintf('2D: n = %d, NoPrecondCondNumPowerMethod = %d, JacobianPrecondCondNumPowerMethod = %d, JacobianRatioCondNumPowerMethod = %f\n',...
        n,NoPrecondCondNumPowerMethod,JacobianPrecondCondNumPowerMethod,JacobianRatioCondNumPowerMethod);
    if ~ doSvd
        tic
        NoPrecondIter=calculateCGIterations2D(NoPrecondH,cgtol,1000,0,n,0,precision);
        JacobianPrecondIter=calculateCGIterations2D(JacobianPrecondH,cgtol,1000,0,n,0,precision);
        %DiagonalPrecondIter=calculateCGIterations2D(DiagonalPrecond,cgtol,1000,0,n,1,precision);
        toc
        fprintf('2D: finished calculating CG Iterations\n');
        JacobianRatioIter=JacobianPrecondIter/NoPrecondIter;
        %DiagonalRatioIter=DiagonalPrecondIter/NoPrecondIter;
        %DiagonalRatioCondNumPowerMethod=DiagonalPrecondCondNumPowerMethod/NoPrecondCondNumPowerMethod;
        %fprintf('2D: n = %d, NoPrecondIter = %d, JacobianPrecondIter = %d, JacobianRatioIter = %f, DiagonalPrecondIter = %d, DiagonalRatioIter = %f\n',...
        %    n,NoPrecondIter,JacobianPrecondIter,JacobianRatioIter,DiagonalPrecondIter,DiagonalRatioIter);
        %fprintf('2D: n = %d, NoPrecondCondNumPowerMethod = %d, JacobianPrecondCondNumPowerMethod = %d, JacobianRatioCondNumPowerMethod = %f, DiagonalPrecondCondNumPowerMethod = %d, DiagonalRatioCondNumPowerMethod = %f\n',...
        %    n,NoPrecondCondNumPowerMethod,JacobianPrecondCondNumPowerMethod,JacobianRatioCondNumPowerMethod,DiagonalPrecondCondNumPowerMethod,DiagonalRatioCondNumPowerMethod);
        fprintf('2D: n = %d, NoPrecondIter = %d, JacobianPrecondIter = %d, JacobianRatioIter = %f\n',...
            n,NoPrecondIter,JacobianPrecondIter,JacobianRatioIter);
    else
        tic
        NoPrecondSVD=calculateSVD2D(NoPrecondH,n,precision);
        fprintf('2D n = %d NoPrecond SVD calculation took:\n',n);
        toc
        tic
        JacobianPrecondSVD=calculateSVD2D(JacobianPrecondH,n,precision);
        fprintf('2D n = %d JacobianPrecond SVD calculation took:\n',n);
        toc

        JacobianPrecondCondNumByDef=(JacobianPrecondSVD(1)/JacobianPrecondSVD(end));
        NoPrecondCondNumByDef=(NoPrecondSVD(1)/NoPrecondSVD(end));
        ratioCondNumByDef=JacobianPrecondCondNumByDef/NoPrecondCondNumByDef;
        fprintf('2D: finished calculating condition number by definition\n');
        fprintf('2D: n = %d, NoPrecondCondNumByDef = %f, JacobianPrecondCondNumByDef = %f, ratioCondNumByDef = %f\n',...
            n,NoPrecondCondNumByDef,JacobianPrecondCondNumByDef,ratioCondNumByDef);
    end
end
